package com.cloudeasy.provider.service;

import com.cloudeasy.annotation.NoNeedAccessAuthentication;
import com.cloudeasy.provider.model.dto.robot.ChatRobotMsgDto;
import com.cloudeasy.provider.service.hystrix.DingtalkFeignApiHystrix;
import com.cloudeasy.security.feign.OAuth2FeignAutoConfiguration;
import com.cloudeasy.wrapper.Wrapper;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * Create By 郭金宝 on 2019/1/17.<br>
 */
@FeignClient(value = "cloudeasy-provider-opc", configuration = OAuth2FeignAutoConfiguration.class, fallback = DingtalkFeignApiHystrix.class)
public interface DingtalkFeignApi {

    /**
     * 钉钉机器人推送消息.
     *
     * @param uacUserReqDto the uac user req dto
     *
     * @return the wrapper
     */
    @PostMapping(value = "/api/opc/dingtalk/sendChatRobotMsg")
    @NoNeedAccessAuthentication
    Wrapper<Boolean> sendChatRobotMsg(@RequestBody ChatRobotMsgDto uacUserReqDto);
}
